import request from '@/utils/request'

export function list(query) {
    return request({
        url: '/mall/act/list',
        method: 'get',
        params: query
    })
}

export function info(id) {
    return request({
        url: '/mall/act/info/' + id,
        method: 'get'
    })
}

export function save(data) {
    console.log(data);
    return request({
        url: '/mall/act/save',
        method: 'post',
        data
    })
}

export function update(data) {
    return request({
        url: '/mall/act/update',
        method: 'post',
        data
    })
}

export function remove(data) {
    return request({
        url: '/mall/act/delete',
        method: 'post',
        data
    })
}

export function getGoodsByShop(userId) {
    return request({
        url:'/mall/act/findByUserId/'+userId,
        method:'get'
    })
}

export function setActivityGoods(goodsId) {
    return request({
        url:'/mall/act/findByGoodsIdOrUserId',
        method:'post',
        data:{goodsId}
    })
}

export function setChangeBind(actId) {
    return request({
        url:'/mall/act/untieAct/'+actId,
        method:'get'
    })
}

